package c.c.c.a.c;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import c.c.c.a.c.c.a;
import c.c.c.a.i.c;
import c.c.c.a.n;

/* compiled from: NpthDataManager */
public class b {
    public static volatile b c;
    public a a;
    public SQLiteDatabase b;

    public static b a() {
        if (c == null) {
            synchronized (b.class) {
                if (c == null) {
                    c = new b();
                }
            }
        }
        return c;
    }

    public void b(Context context) {
        try {
            this.b = new d(context).getWritableDatabase();
        } catch (Throwable unused) {
            context = n.a;
            c cVar = n.d;
        }
        this.a = new a();
    }

    public synchronized void c(c.c.c.a.c.a.a aVar) {
        a aVar2 = this.a;
        if (aVar2 != null) {
            aVar2.a(this.b, aVar);
        }
    }

    public synchronized boolean d(String str) {
        a aVar = this.a;
        if (aVar == null) {
            return false;
        }
        return aVar.b(this.b, str);
    }
}
